function x=onesided_ma(y,alpha,fobs);
nn=rows(y);
weights=(1-alpha).^seqa(fobs-1,-1,fobs);
gap=zeros(nn,1);
for j=fobs:nn;
    gap(j)=y(j)-alpha*sum(weights.*y(j-fobs+1:j));
end;
x=gap(fobs:nn);
